"""
开放商户 - 账单下载查询相关模型
"""

from jlpay.model.base import OrgBaseReq, BaseResponse


class BillDownloadQueryRequest(OrgBaseReq):
    """账单下载查询请求"""
    
    API_URL = "/open/bill/download/query"
    
    def __init__(self):
        """初始化账单下载查询请求"""
        super().__init__()
        self.bill_type = None
        self.dt = None
    
    def set_bill_type(self, bill_type):
        """
        设置账单类型
        
        Args:
            bill_type: 账单类型
            
        Returns:
            BillDownloadQueryRequest实例
        """
        self.bill_type = bill_type
        return self
    
    def set_dt(self, dt):
        """
        设置账单日期yyyyMMdd
        
        Args:
            dt: 账单日期，格式yyyyMMdd
            
        Returns:
            BillDownloadQueryRequest实例
        """
        self.dt = dt
        return self


class BillDownloadQueryResponse(BaseResponse):
    """账单下载查询响应"""
    
    def __init__(self, response_dict=None):
        """初始化账单下载查询响应"""
        super().__init__(response_dict)
        self.file_url = None
        
        if response_dict:
            self.file_url = response_dict.get('file_url') 